package com.android.example.livewallpaperdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
import android.app.Activity;
import android.app.WallpaperManager;
import android.content.ComponentName;
import android.content.Intent;
import android.preference.PreferenceActivity;

public class LiveWallpaperDemoActivity extends PreferenceActivity
{	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);		
		// Intent wallpaperSettings = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
		// wallpaperSettings.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(this, LiveWallpaperDemoService.class));
		// Intent wallpaperSettings = new Intent(Intent.ACTION_SET_WALLPAPER);
		// startActivity(wallpaperSettings);
        setContentView(R.layout.main);
    }
	
	public boolean onClick(View view) { 
		// Intent wallpaperSettings = new Intent(Intent.ACTION_SET_WALLPAPER);
		// startActivity(wallpaperSettings);
		// Intent wallpaperSettings = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
		Intent wallpaperSettings = new Intent("com.android.example.livewallpaperdemo.LiveWallpaperDemoService");
		wallpaperSettings.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(this, LiveWallpaperDemoService.class));		
		startActivity(wallpaperSettings);
		return true;
    }
}
